package com.faxsun.core.readonly.dao.impl;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import mtons.modules.persist.impl.DaoImpl;

import com.faxsun.core.readonly.dao.ProductDao;
import com.faxsun.core.readonly.entity.ProductRO;

public class ProductDaoImpl extends DaoImpl<ProductRO> implements ProductDao {

	/**
	 * 
	 */
	private static final long serialVersionUID = 7410837986039772119L;

	public ProductDaoImpl() {
		super(ProductRO.class);
	}
	
	@SuppressWarnings("unchecked")
	@Override
	public List<ProductRO> list(Long productId) {
		Criteria c=this.createCriteria();
		c.add(Restrictions.gt("id", productId));
		c.add(Restrictions.ne("archived", 'Y'));
		return c.list();
	}

}
